<?php

/**
 * contact : 刘经理 19326416371
 * company : 版权所属 四川北星惯牌科技有限公司
 **/

namespace app\common\constant;

use think\Env;

class Constant
{

    CONST REGION_KEY = 'region_key';
    CONST CONFIG_KEY = 'config_key';
    CONST PAGE_LIMIT = 10;

    CONST HASH_ALL_TEAM_KEY = 'HASH_ALL_TEAM_KEY';
    CONST HASH_ALL_MATCH_KEY = 'HASH_ALL_MATCH_KEY';
    CONST LIST_END_MATCH_KEY = 'LIST_END_MATCH_KEY';

    public static function getHashAllTeamKey($prefix='',$key='')
    {
        return $prefix.self::HASH_ALL_TEAM_KEY.'_'.($key ?: date('Ymd',time()));
    }

    public static function getHashAllMatchKey($prefix='',$key='')
    {
        return $prefix.self::HASH_ALL_MATCH_KEY.'_'.($key?:date('Ymd',time()));
    }

    public static function getConfigKey($prefix='')
    {
        return $prefix.self::CONFIG_KEY;
    }

    public static function getEndMatchListKey($prefix=''){
        return $prefix.self::LIST_END_MATCH_KEY;
    }

    public static function getAesKey()
    {
        return Env::get('encrypt.aes_key');
    }
}